package Statistics;

/**
 * Specifies how the crit rate attribute will act.
 * @author Hetalar
 * 08/02/2012 
 */
public class ATKPower extends Stat
{	
	private static final String STAT_NAME = "ATK Power";
	
	public ATKPower(Statistics stat, int startingValue)
	{
		super(stat, startingValue, STAT_NAME, Statistics.STAT_ATK_POWER);
	}
	
	public ATKPower(Statistics stat)
	{
		super(stat, 0, STAT_NAME, Statistics.STAT_ATK_POWER);
	}
	
	protected void applyStat(int oldValue)
	{
		double change = oldValue - this.statistic.getStatValue(this.statistic.getPrimaryStat());
																					
		if(change != 0)
		{
			this.statistic.increaseStat(Statistics.STAT_DMG, 
					Coefficients.calcPrimStatChange(change, statistic));
		}
	}
}
